﻿namespace BM.Tools.WebControls.MForm.Example.Core
{
    using System;
    using System.Linq;
    using System.Web.UI;

    using BM.Tools.WebControls.MForm.Navigation;

    using Controls;

    /// <summary>
    /// </summary>
    public partial class AddingRemoving : Page
    {
        /// <summary>
        /// </summary>
        /// <param name="sender">
        /// The sender.
        /// </param>
        /// <param name="e">
        /// The e.
        /// </param>
        protected void Button1_Click(object sender, EventArgs e)
        {
            var addButtons = Master.FindControl("AddButtons") as AddButtons;
            addButtons.CountEmptyContainers =
                    Controller.Select("//CountEmptyContainers").Leafs().First().GetValue<bool>();
            addButtons.Depth = Controller.Select("//Depth").Leafs().First().GetValue<int>();
        }

        /// <summary>
        /// </summary>
        /// <param name="sender">
        /// The sender.
        /// </param>
        /// <param name="e">
        /// The e.
        /// </param>
        protected void Page_Load(object sender, EventArgs e)
        {
            Root1.NotifyToolbox();
            CultureInfoLiteral.Text = System.Globalization.CultureInfo.CurrentCulture.Name;
        }
    }
}